From 7880142fc739a0bd9b6e2ca703f4da88952580ba Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Thu, 11 Aug 2005 21:52:22 +0000 Subject: [PATCH] Fix loop iterator aliasing in x86/32 memory initialisation. Signed-off-by: Jerone Young --- xen/arch/x86/x86_32/mm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xen/arch/x86/x86_32/mm.c b/xen/arch/x86/x86_32/mm.c index 22021a8e36..66fde57f20 100644 --- a/xen/arch/x86/x86_32/mm.c +++ b/xen/arch/x86/x86_32/mm.c @@ -150,7 +150,7 @@ void __init zap_low_mappings(l2_pgentry_t *base) void subarch_init_memory(struct domain *dom_xen) { unsigned long m2p_start_mfn; - int i; + unsigned int i, j; /* * We are rather picky about the layout of 'struct pfn_info'. The @@ -174,12 +174,12 @@ void subarch_init_memory(struct domain *dom_xen) { m2p_start_mfn = l2e_get_pfn( idle_pg_table_l2[l2_linear_offset(RDWR_MPT_VIRT_START) + i]); - for ( i = 0; i < L2_PAGETABLE_ENTRIES; i++ ) + for ( j = 0; j < L2_PAGETABLE_ENTRIES; j++ ) { - frame_table[m2p_start_mfn+i].count_info = PGC_allocated | 1; + frame_table[m2p_start_mfn+j].count_info = PGC_allocated | 1; /* Ensure it's only mapped read-only by domains. */ - frame_table[m2p_start_mfn+i].u.inuse.type_info = PGT_gdt_page | 1; - page_set_owner(&frame_table[m2p_start_mfn+i], dom_xen); + frame_table[m2p_start_mfn+j].u.inuse.type_info = PGT_gdt_page | 1; + page_set_owner(&frame_table[m2p_start_mfn+j], dom_xen); } } } -- 2.30.2